package model.dao;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import model.vo.AssetBaseVO;
import model.vo.AssetImpotantVO;
import model.vo.AssetListVO;
import model.vo.AssetPercenTageVO;
import model.vo.AssetScVO;
import model.vo.JobProcessVO;
import model.vo.OptinfoVO;
import model.vo.PyungBaseVO;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class AssetDAOImpl extends SqlMapClientDaoSupport implements AssetDAO {
	//[자산 평가 IPO]
	//1.카탈로그
	//(자산분류기준)
	//자산분류기준페이지로 이동
	@Override
	public List assetBase() throws SQLException {
		return super.getSqlMapClientTemplate().getSqlMapClient().queryForList("asset.assetBase");
	}
	//최대 순번 구해오기
	@Override
	public Integer assetBase_maxNo() throws SQLException {
		return (Integer) super.getSqlMapClientTemplate().getSqlMapClient().queryForObject("asset.assetBase_maxNo");
	}
	//자산 분류 기준 등록
	@Override
	public void assetBase_insert(AssetBaseVO vo) throws SQLException {
		super.getSqlMapClientTemplate().getSqlMapClient().insert("asset.assetBase_insert", vo);
	}
	//자산 분류 기준 삭제
	@Override
	public void assetBase_delete(int asset_no) throws SQLException {
		// TODO Auto-generated method stub
		super.getSqlMapClientTemplate().getSqlMapClient().delete("asset.assetBase_delete", asset_no);
	}
	//자산 분류 수정 페이지로 이동
	@Override
	public AssetBaseVO assetBase_updatePage(int asset_no) throws SQLException {
		// TODO Auto-generated method stub
		return (AssetBaseVO) super.getSqlMapClientTemplate().getSqlMapClient().queryForObject("asset.assetBase_updatePage", asset_no);
	}
	//자산 분류 수정
	@Override
	public void assetBase_update(AssetBaseVO vo) throws SQLException {
		// TODO Auto-generated method stub
		super.getSqlMapClientTemplate().getSqlMapClient().update("asset.assetBase_update", vo);
	}
	
	
	
	//(업무프로세스)
	//업무프로세스 페이지로 이동
	@Override
	public List jobProcess() throws SQLException {
		return super.getSqlMapClientTemplate().getSqlMapClient().queryForList("asset.jobProcess");
	}
	//최대 순번 구해오기
	@Override
	public Integer jobProcess_maxNo() throws SQLException {
		// TODO Auto-generated method stub
		return (Integer) super.getSqlMapClientTemplate().getSqlMapClient().queryForObject("asset.jobProcess_maxNo");
	}
	//업무프로세스 등록
	@Override
	public void jobProcess_insert(JobProcessVO vo) throws SQLException {
		// TODO Auto-generated method stub
		super.getSqlMapClientTemplate().getSqlMapClient().insert("asset.jobProcess_insert", vo);
	}
	//업무프로세스 삭제
	@Override
	public void jobProcess_delete(int job_no) throws SQLException {
		// TODO Auto-generated method stub
		super.getSqlMapClientTemplate().getSqlMapClient().delete("asset.jobProcess_delete", job_no);
	}
	//업무프로세스 수정 페이지로 이동
	@Override
	public JobProcessVO jobProcess_updatePage(int job_no) throws SQLException {
		// TODO Auto-generated method stub
		return (JobProcessVO) super.getSqlMapClientTemplate().getSqlMapClient().queryForObject("asset.jobProcess_updatePage", job_no);
	}
	//업무프로세스 수정
	@Override
	public void jobProcess_update(JobProcessVO vo) throws SQLException {
		// TODO Auto-generated method stub
		super.getSqlMapClientTemplate().getSqlMapClient().update("asset.jobProcess_update", vo);
	}
	
	
	
	
	
	
	//2.평가기준
	//(업무프로세스중요도)
	//업무프로세스 중요도 페이지로 이동
	@Override
	public List pyungBase() throws SQLException {
		// TODO Auto-generated method stub
		return super.getSqlMapClientTemplate().getSqlMapClient().queryForList("asset.pyungBase");
	}
	//최대 순번 구해오기
	@Override
	public Integer pyung_maxNo() throws SQLException {
		// TODO Auto-generated method stub
		return (Integer) super.getSqlMapClientTemplate().getSqlMapClient().queryForObject("asset.pyung_maxNo");
	}
	//업무프로세스 중요도 등록
	@Override
	public void pyung_insert(PyungBaseVO vo) throws SQLException {
		// TODO Auto-generated method stub
		super.getSqlMapClientTemplate().getSqlMapClient().insert("asset.pyung_insert", vo);
	}
	//업무프로세스 중요도 삭제
	@Override
	public void pyung_delete(int no) throws SQLException {
		// TODO Auto-generated method stub
		super.getSqlMapClientTemplate().getSqlMapClient().delete("asset.pyung_delete", no);
	}
	//업무프로세스 중요도 수정페이지로 이동
	@Override
	public PyungBaseVO pyung_updatePage(int no) throws SQLException {
		// TODO Auto-generated method stub
		return (PyungBaseVO) super.getSqlMapClientTemplate().getSqlMapClient().queryForObject("asset.pyung_updatePage", no);
	}
	//업무프로세스 중요도 수정
	@Override
	public void pyung_update(PyungBaseVO vo) throws SQLException {
		// TODO Auto-generated method stub
		super.getSqlMapClientTemplate().getSqlMapClient().update("asset.pyung_update", vo);
	}
	
	
	
	//(자산중요도평가기준)
	//자산중요도평가기준 페이지로 이동
	@Override
	public List assetImpotant() throws SQLException {
		// TODO Auto-generated method stub
		return super.getSqlMapClientTemplate().getSqlMapClient().queryForList("asset.assetImpotant");
	}
	//최대 순번 구해오기
	@Override
	public Integer assetImpotant_maxNo() throws SQLException {
		// TODO Auto-generated method stub
		return (Integer) super.getSqlMapClientTemplate().getSqlMapClient().queryForObject("asset.assetImpotant_maxNo");
	}
	//자산중요도평가기준 등록
	@Override
	public void assetImpotant_insert(AssetImpotantVO vo) throws SQLException {
		// TODO Auto-generated method stub
		super.getSqlMapClientTemplate().getSqlMapClient().insert("asset.assetImpotant_insert", vo);
	}
	//자산중요도평가기준 삭제
	@Override
	public void assetImpotant_delete(int impo_no) throws SQLException {
		// TODO Auto-generated method stub
		super.getSqlMapClientTemplate().getSqlMapClient().delete("asset.assetImpotant_delete", impo_no);
	}
	//자산중요도평가기준 수정페이지로 이동
	@Override
	public AssetImpotantVO assetImpotant_updatePage(int impo_no) throws SQLException {
		// TODO Auto-generated method stub
		return (AssetImpotantVO) super.getSqlMapClientTemplate().getSqlMapClient().queryForObject("asset.assetImpotant_updatePage", impo_no);
	}
	//자산중요도평가기준 수정
	@Override
	public void assetImpotant_update(AssetImpotantVO vo) throws SQLException {
		// TODO Auto-generated method stub
		super.getSqlMapClientTemplate().getSqlMapClient().update("asset.assetImpotant_update", vo);
	}
	
	
	
	//(자산보안등급평가)
	//자산보안등급평가 페이지로 이동
	@Override
	public List assetSecurity(String gubun) throws SQLException {
		// TODO Auto-generated method stub
		return super.getSqlMapClientTemplate().getSqlMapClient().queryForList("asset.assetSecurity",gubun);
	}
	//최대 순번 구해오기
	@Override
	public Integer assetSecurity_maxNo(String gubun) throws SQLException {
		// TODO Auto-generated method stub
		return (Integer) super.getSqlMapClientTemplate().getSqlMapClient().queryForObject("asset.assetSecurity_maxNo", gubun);
	}
	//자산보안등급평가 등록
	@Override
	public void assetSecurity_insert(AssetScVO vo) throws SQLException {
		// TODO Auto-generated method stub
		super.getSqlMapClientTemplate().getSqlMapClient().insert("asset.assetSecurity_insert", vo);
	}
	//자산보안등급평가 삭제
	@Override
	public void assetSecurity_delete(AssetScVO vo) throws SQLException {
		// TODO Auto-generated method stub
		super.getSqlMapClientTemplate().getSqlMapClient().delete("asset.assetSecurity_delete", vo);
	}
	//자산보안등급평가 수정페이지로 이동
	@Override
	public AssetScVO assetSecurity_updatePage(AssetScVO vo) throws SQLException {
		// TODO Auto-generated method stub
		return (AssetScVO) super.getSqlMapClientTemplate().getSqlMapClient().queryForObject("asset.assetSecurity_updatePage", vo);
	}
	//자산보안등급평가 수정
	@Override
	public void assetSecurity_update(AssetScVO vo) throws SQLException {
		// TODO Auto-generated method stub
		super.getSqlMapClientTemplate().getSqlMapClient().update("asset.assetSecurity_update", vo);
	}
	
	
	
	
	
	//3.자산 식별 및 평가 
	//(자산 식별)  
	//자산 식별 페이지로 이동
	@Override
	public List assetIdenty_list(AssetListVO vo) throws SQLException {
		// TODO Auto-generated method stub
		return super.getSqlMapClientTemplate().getSqlMapClient().queryForList("asset.assetIdenty_list",vo);
	}
	@Override
	public boolean searchAcd(String a_cd) throws SQLException {
		boolean flag=false;
		String str=(String) super.getSqlMapClientTemplate().getSqlMapClient().queryForObject("asset.searchAcd", a_cd);
		if(str!=null){
			flag=true;
		}
		return flag;
	}
	//자산 식별 등록
	@Override
	public void assetIdenty_insert(AssetListVO vo) throws SQLException {
		// TODO Auto-generated method stub
		super.getSqlMapClientTemplate().getSqlMapClient().insert("asset.assetIdenty_insert", vo);
	}
	//자산 식별(추가테이블) 등록
	@Override
	public void assetIdenty_insertOpt(OptinfoVO vo) throws SQLException {
		// TODO Auto-generated method stub
		super.getSqlMapClientTemplate().getSqlMapClient().insert("asset.assetIdenty_insertOpt", vo);
	}
	//자산 식별 삭제
	@Override
	public void assetIdentyDelete(String deleteACd) throws SQLException {
		// TODO Auto-generated method stub
		super.getSqlMapClientTemplate().getSqlMapClient().delete("asset.assetIdentyDelete", deleteACd);
	}
	//자산 식별(추가테이블) 삭제
	@Override
	public void assetIdentyOptDelete(String deleteACd) throws SQLException {
		// TODO Auto-generated method stub
		super.getSqlMapClientTemplate().getSqlMapClient().delete("asset.assetIdentyOptDelete", deleteACd);
	}
	//자산 식별 수정 페이지로 이동
	@Override
	public AssetListVO assetIdenty_updatePage(String a_cd) throws SQLException {
		// TODO Auto-generated method stub
		return (AssetListVO) super.getSqlMapClientTemplate().getSqlMapClient().queryForObject("asset.assetIdenty_updatePage", a_cd);
	}
	//자산 식별 수정 페이지로 이동(optVO정보)
	@Override
	public OptinfoVO assetIdentyOpt_updatePage(String a_cd) throws SQLException {
		// TODO Auto-generated method stub
		return (OptinfoVO) super.getSqlMapClientTemplate().getSqlMapClient().queryForObject("asset.assetIdentyOpt_updatePage", a_cd);
	}
	//자산 식별 수정
	@Override
	public void assetIdenty_update(AssetListVO vo) throws SQLException {
		// TODO Auto-generated method stub
		super.getSqlMapClientTemplate().getSqlMapClient().insert("asset.assetIdenty_update", vo);
	}
	//자산 식별(추가테이블) 수정
	@Override
	public void assetIdenty_updateOpt(OptinfoVO vo) throws SQLException {
		// TODO Auto-generated method stub
		super.getSqlMapClientTemplate().getSqlMapClient().insert("asset.assetIdenty_updateOpt", vo);
	}
	
	
	
	//(자산 평가)  
	//자산 평가 페이지로 이동
	@Override
	public List assetResult_list(AssetListVO vo) throws SQLException {
		// TODO Auto-generated method stub
		return super.getSqlMapClientTemplate().getSqlMapClient().queryForList("asset.assetResult_list",vo);
	}
	// sc_score(점수 테이블 호출)
	@Override
	public List sc_score(String gubun) throws SQLException {
		// TODO Auto-generated method stub
		return super.getSqlMapClientTemplate().getSqlMapClient().queryForList("asset.sc_score",gubun);
	}
	//자산 평가 수정 페이지로 이동
	@Override
	public AssetListVO assetResult_updatePage(String a_cd) throws SQLException {
		// TODO Auto-generated method stub
		return (AssetListVO) super.getSqlMapClientTemplate().getSqlMapClient().queryForObject("asset.assetResult_updatePage", a_cd);
	}
	//자산 평가 수정
	@Override
	public void assetResult_update(AssetListVO vo) throws SQLException {
		// TODO Auto-generated method stub
		super.getSqlMapClientTemplate().getSqlMapClient().insert("asset.assetResult_update", vo);
	}
	
	
	
	//(자산 목록)  
	//자산 목록 페이지로 이동
	@Override
	public List assetList(AssetListVO vo) throws SQLException {
		// TODO Auto-generated method stub
		return super.getSqlMapClientTemplate().getSqlMapClient().queryForList("asset.assetList",vo);
	}
	/*//퍼센테이지 계산
	@Override
	public float percenTage(HashMap map) throws SQLException {
		// TODO Auto-generated method stub
		return (Float) super.getSqlMapClientTemplate().queryForObject("asset.percenTage",map);
	}*/
	// 카운터 계산
	@Override
	public Map counts(HashMap map) throws SQLException {
		// TODO Auto-generated method stub
		return (Map) super.getSqlMapClientTemplate().queryForObject("asset.counts",map);
	}
	//퍼센테이지 계산
	@Override
	public AssetPercenTageVO percenTage(AssetPercenTageVO vo)
			throws SQLException {
		// TODO Auto-generated method stub
		return (AssetPercenTageVO) super.getSqlMapClientTemplate().queryForObject("asset.percenTage",vo);
	}
	
	
}
